﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Xml;

namespace GPCSC.Web.AJAX
{
    /// <summary>
    /// ldgblb 的摘要说明
    /// </summary>
    public class ldgblb : IHttpHandler
    {

        public void ProcessRequest(HttpContext context)
        {
            context.Response.ContentType = "text/plain";
            context.Response.Write("Hello World");
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
        #region IHttpHandler 成员

        bool IHttpHandler.IsReusable
        {
            get { throw new NotImplementedException(); }
        }
        /// <summary>
        /// 保存活动
        /// </summary>
        /// <param name="context"></param>
        void IHttpHandler.ProcessRequest(HttpContext context)
        {
            try
            {
                string text = "";
                string iden = context.Request["iden"].ToString();
                string strXMLPath = "";
                if (iden == "1")
                {
                    strXMLPath = context.Server.MapPath("~/SYS_ORG/XMLFile1.xml");
                }
                else
                {
                    strXMLPath = context.Server.MapPath("~/SYS_ORG/ldgblb.xml");
                   
                }
                XmlDocument xmlDoc = new XmlDocument();
                xmlDoc.Load(strXMLPath);
                XmlNodeList nodes = xmlDoc.DocumentElement.SelectNodes("text");
                foreach (XmlNode node in nodes)
                {

                        text +="<option>"+node.InnerText+"</option>";
                 
                }
                context.Response.Write(text);
            }
            catch (Exception ee)
            {
                throw ee;
            }

        }

        #endregion
    }
}